<?php
/**
  * //w/w/w.s/h/u/o/t//u/p/u c/o/m  说 图/谱/源/码/分/享
 */
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/26 0026
 * Time: 下午 3:32
 */
defined("IN_IA")or exit("Access denied");
global $_GPC,$_W;
$uniacid=$_GPC['uniacid'];
$op=$_GPC['op'] ? $_GPC['op'] :"index";
$uid=$_GPC['uid'];

if($op=='getLiveData'){
    $request=array();
    $liveType=pdo_getall('cqkundian_farm_live_type',array('uniacid'=>$uniacid,'status'=>1));
    $request['liveType']=$liveType;

    $liveData=pdo_getall('cqkundian_farm_live',array('uniacid'=>$uniacid,'status'=>1));
    for($i=0;$i<count($liveData);$i++){
        $liveData[$i]['live']=false;
    }
    $request['liveData']=$liveData;
    echo json_encode($request);die;
}

//根据直播分类获取信息
if($op=='getLiveTypeData'){
    $request=array();
    $type_id=$_GPC['type_id'];
    $request['type_id']=$type_id;
    if($type_id==0) {
        $liveData = pdo_getall('cqkundian_farm_live', array('uniacid' => $uniacid,'status'=>1));
        $request['ces']=1;
    }else{
        $liveData = pdo_getall('cqkundian_farm_live', array('uniacid' => $uniacid, 'type_id' => $type_id,'status'=>1));
        $request['ces']=2;
    }
    $request['liveData']=$liveData;
    echo json_encode($request);die;
}